<div xmlns:nxu="http://nuxeo.org/nxweb/util"
  xmlns:ui="http://java.sun.com/jsf/facelets"
  xmlns:h="http://java.sun.com/jsf/html"
  xmlns:c="http://java.sun.com/jstl/core"
  class="content_block">

  <c:if test="#{fieldOrValue.hasFacet('Picture')}">

    <c:if test="#{!empty widget.label and widget.handlingLabels}">
      <ui:include src="/widgets/incl/widget_label_template.xhtml">
        <ui:param name="labelStyleClass" value="summaryTitle" />
      </ui:include>
    </c:if>

    <table width="100%" cellspacing="0">
      <tbody>
      <c:forEach var="view" items="#{fieldOrValue.picture.views}"
        varStatus="status">
        <tr>
          <td class="labelColumn">
            <nxu:set var="labelKey" value="label.picture.view.#{view.title}">
            <nxu:set var="labelValue" value="#{messages[labelKey]}">
            <nxu:set var="finalLabel" value="#{nxu:test(labelKey == labelValue, view.title, labelValue)}">
              <h:outputText value="#{finalLabel}"
                title="#{view.description}"
                styleClass="tipsyShow" />
            </nxu:set>
            </nxu:set>
            </nxu:set>
          </td>
          <td class="fieldColumn">
            <span>#{view.info.width}</span>
            <span class="dimensionSeparator"></span>
            <span>#{view.info.height}</span>
          </td>
          <td class="fieldColumn">
            <c:if test="#{!empty view.content}">
              <span class="detail">#{nxu:printFileSize(view.content.length)}</span>
            </c:if>
          </td>
          <td class="fieldColumn">
            <c:if test="#{! empty view.info}">
              <span class="label">#{view.info.format}</span>
            </c:if>
            <c:if test="#{empty view.info}">
              <c:if test="#{!empty view.content}">
                <c:set var="extension" value="#{nxu:fileExtension(view.content.name)}" />
                <c:if test="#{not empty extension}">
                  <h:outputText value="#{extension}"
                    styleClass="label" />
                </c:if>
              </c:if>
            </c:if>
          </td>
          <td class="actionsColumn">
            <nxu:set var="blobPropertyName" value="#{view.title}:content">
              <h:outputLink value="#{nxd:fileUrl('downloadPicture', fieldOrValue, blobPropertyName, fieldOrValue.dublincore.modified)}">
                <h:graphicImage url="/icons/contextual_menu/download.png" />
              </h:outputLink>
            </nxu:set>
          </td>
        </tr>
      </c:forEach>
      </tbody>
    </table>

  </c:if>

</div>
